//
// Created by LiuDongPeng on 2023/11/16.
//

#ifndef FOC_FOC_H
#define FOC_FOC_H

#include "main.h"
#include "arm_math.h"



/**
 * @brief
 */
#define SQRT_3          1.732050807568877f
#define SQRT_3_DIV_2    0.866025403784438f



void foc_clark(float32_t ia, float32_t ib, float32_t ic, float32_t* ialpha, float32_t* ibeta);
void foc_inv_clark();

void foc_park(float32_t ialpha, float32_t ibeta, float32_t sinTheta, float32_t cosTheta, float32_t* id, float32_t* iq);
void foc_inv_park(float32_t ud, float32_t uq, float32_t sinTheta, float32_t cosTheta, float32_t* ualpha, float32_t* ubeta);

void foc_svpwm(float32_t ualpha, float32_t ubeta, float32_t udc, float32_t tpwm,
               float32_t* ta, float32_t* tb, float32_t* tc);





#endif //FOC_FOC_H
